Alright I'm tackling an assignment and I just started with the input of numbers into an array. It seems to be working well, but what happens is once the for loop should be over, it repeats but not at zero like it should (If I wanted it to, which I don't). I'm confused so here's my code:
Code:
#include <stdio.h>
#define ARRSIZE 19
int main(){
int temp[ARRSIZE];
int press[ARRSIZE];
int i;
printf("\n--------------------------------------------------\n");
printf(" Please enter a temperature and a pressure value.\n");
for(i = 0; i <= ARRSIZE; i++){
printf("%d: ", i+1);
scanf("%d %d", &temp[i], &press[i]);
} /* for() filling arrays with input */
printf("Thank you!");
return 0;
} /* main() */
When it starts the next iteration it starts with i=2 which I'm confused about only slightly less than why it's even looping again in the first place.